//
//  WJBSTool.m
//  WJBSApp
//
//  Created by rumble on 2018/11/22.
//  Copyright © 2018年 王景伟. All rights reserved.
//

#import "WJBSTool.h"

@implementation WJBSTool

+ (NSArray *)getSafeArray:(id)array {
    if ([array isKindOfClass:[NSArray class]]) {
        return (NSArray *)array;
    } else {
        return [NSArray array];
    }
}

+ (NSDictionary *)getSafeDictory:(id)dic {
    if ([dic isKindOfClass:[NSDictionary class]])
        return (NSDictionary *)dic;
    else
        return [NSDictionary dictionary];
}

+ (BOOL)isBlankString:(NSString *)string {
    if (string == nil || string == NULL || ![string isKindOfClass:[NSString class]]) {
        return YES;
    }
    if ([string isKindOfClass:[NSNull class]]) {
        return YES;
    }
    if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
        return YES;
    }
    return NO;
}
@end
